<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="__WX__/mui/css/mui.min.css" rel="stylesheet" />
		<link href="__WX__/css/iconfont.css" rel="stylesheet" />
	</head>
	<style>
		ul li{
			list-style: none;
			padding:0;
			margin:0;
			border:0;
		}
		.mui-bar-tab .mui-tab-item.mui-active{
			color:#53caff	
		}
		
	</style>
	<body style="margin:0px;background-color:#fff">
		<script src="__WX__/js/jquery.min.js"></script>
		<div class="mui-content" style="background-color:#fff">
			<header class="mui-bar mui-bar-nav" >
			  <a class="mui-icon mui-icon-left-nav mui-pull-left" style="color:#53caff" href="javascript:history.back(-1)"></a>
			  <a class="mui-icon mui-icon-reply mui-pull-right"></a>
			  <h1 class="mui-title">我的订单</h1>
			</header>
			<ul class="mui-table-view" style="margin-top:40px;">
				<li class="mui-table-view-cell mui-hidden">
					<div id="M_Toggle" class="mui-switch mui-active">
						<div class="mui-switch-handle"></div>
					</div>
				</li>


				{if condition="isset($table1s) &&  !empty($table1s)"}
				{volist name="table1s" id="v"}
				<li class="mui-table-view-cell mui-media">

						<div class="mui-media-body">
							<a href="{:url('Order/orderdetail')}?mid={$v.manage.id}&&tid={$v.id}">
								<img class="mui-media-object mui-pull-right" src="__WX__/img/chakan.png">
							</a>
							订单编号1：{$v.order_num}
							<p class='mui-ellipsis'>下单时间：{:date('Y-m-d H:i:s',$v['create_time'])}</p>

							<p class='mui-ellipsis'>姓名：{$v.register.name}</p>

							<p class='mui-ellipsis'>
							<p class='mui-ellipsis' style="float:left">押金：{$v.manage.money}元</p>
							{if condition="$v.status==1 || $v.status==2"}
							<p class='mui-ellipsis' style="float:right;color:lightseagreen" onclick="apply_return1('{$v.id}','{$v.order_num}','{$v.manage.money}','{$v.register.name}','{$v.apply_id}','{$v.manage.id}',1)">申请退还</p>
							{/if}
						</div>
					<div class="mui-media-body"  style="border-bottom:1px solid #ccc;text-align: center;;">
						{if condition="$v.status === 1"}
						<p style="color:#53caff">待商户确认...</p>
						{elseif condition="$v.status === 2"/}
						<p style="color:#53caff">商户已确认</p>
						{elseif condition="$v.status === 3"/}
						<p style="color:#53caff">押金退还申请中...</p>
						{elseif condition="$v.status === 4"/}
						<p style="color:#53caff">押金已退还</p>
						{/if}
						<!--
                        <p style="color:#53caff">待押金退还申请中...</p>
                        <p style="color:#53caff">待押金已退还</p>-->
					</div>
				</li>
				{/volist}
				{/if}

				{if condition="isset($table2s) &&  !empty($table2s)"}
				{volist name="table2s" id="v"}
				<li class="mui-table-view-cell mui-media">
						<div class="mui-media-body">
							<a href="{:url('Order/orderdetail')}?mid={$v.manage.id}&&tid={$v.id}">
								<img class="mui-media-object mui-pull-right" src="__WX__/img/chakan.png">
							</a>
							订单编号：{$v.order_num}
							<p class='mui-ellipsis'>下单时间：{:date('Y-m-d H:i:s',$v['create_time'])}</p>

							<p class='mui-ellipsis'>姓名：{$v.register.name}</p>

							<p class='mui-ellipsis'>
							<p class='mui-ellipsis' style="float:left">押金：{$v.manage.money}元</p>
							{if condition="$v.status==1 || $v.status==2"}
							<p class='mui-ellipsis' style="float:right;color:lightseagreen" onclick="apply_return2('{$v.id}','{$v.order_num}','{$v.manage.money}','{$v.register.name}','{$v.apply_id}','{$v.manage.id}',2)">申请退还</p>
							{/if}
							</p>

						</div>
					<div class="mui-media-body"  style="border-bottom:1px solid #ccc;text-align: center;;">
						{if condition="$v.status === 1"}
						<p style="color:#53caff">待商户确认...</p>
						{elseif condition="$v.status === 2"/}
						<p style="color:#53caff">商户已确认</p>
						{elseif condition="$v.status === 3"/}
						<p style="color:#53caff">押金退还申请中...</p>
						{elseif condition="$v.status === 4"/}
						<p style="color:#53caff">押金已退还</p>
						{/if}
						<!--
                        <p style="color:#53caff">待押金退还申请中...</p>
                        <p style="color:#53caff">待押金已退还</p>-->
					</div>
				</li>
				{/volist}
				{/if}

				{if condition="isset($table3s) &&  !empty($table3s)"}
				{volist name="table3s" id="v"}
				<li class="mui-table-view-cell mui-media">
					<div class="mui-media-body">
						<a href="{:url('Order/orderdetail')}?mid={$v.manage.id}&&tid={$v.id}">
							<img class="mui-media-object mui-pull-right" src="__WX__/img/chakan.png">
						</a>
						订单编号：{$v.order_num}
						<p class='mui-ellipsis'>下单时间：{:date('Y-m-d H:i:s',$v['create_time'])}</p>

						<p class='mui-ellipsis'>姓名：{$v.register.name}</p>

						<p class='mui-ellipsis'>
						<p class='mui-ellipsis' style="float:left">押金：{$v.manage.money}元</p>
						{if condition="$v.status==1 || $v.status==2"}
						<p class='mui-ellipsis' style="float:right;color:lightseagreen" onclick="apply_return3('{$v.id}','{$v.order_num}','{$v.manage.money}','{$v.register.name}','{$v.apply_id}','{$v.manage.id}',3)">申请退还</p>
						{/if}
						</p>

					</div>
					<div class="mui-media-body"  style="border-bottom:1px solid #ccc;text-align: center;;">
						{if condition="$v.status === 1"}
						<p style="color:#53caff">待商户确认...</p>
						{elseif condition="$v.status === 2"/}
						<p style="color:#53caff">商户已确认</p>
						{elseif condition="$v.status === 3"/}
						<p style="color:#53caff">押金退还申请中...</p>
						{elseif condition="$v.status === 4"/}
						<p style="color:#53caff">押金已退还</p>
						{/if}
						<!--
                        <p style="color:#53caff">待押金退还申请中...</p>
                        <p style="color:#53caff">待押金已退还</p>-->
					</div>
				</li>
				{/volist}
				{/if}

				{if condition="isset($table4s) &&  !empty($table4s)"}
				{volist name="table4s" id="v"}
				<li class="mui-table-view-cell mui-media">
					<div class="mui-media-body">
						<a href="{:url('Order/orderdetail')}?mid={$v.manage.id}&&tid={$v.id}">
							<img class="mui-media-object mui-pull-right" src="__WX__/img/chakan.png">
						</a>
						订单编号：{$v.order_num}
						<p class='mui-ellipsis'>下单时间：{:date('Y-m-d H:i:s',$v['create_time'])}</p>
						<p class='mui-ellipsis'>姓名：{$v.register.name}</p>
						<p class='mui-ellipsis'>
						<p class='mui-ellipsis' style="float:left">押金：{$v.manage.money}元</p>
						{if condition="$v.status==1 || $v.status==2"}
						<p class='mui-ellipsis' style="float:right;color:lightseagreen" onclick="apply_return4('{$v.id}','{$v.order_num}','{$v.manage.money}','{$v.register.name}','{$v.apply_id}','{$v.manage.id}',4)">申请退还</p>
						{/if}
						</p>
					</div>
					<div class="mui-media-body"  style="border-bottom:1px solid #ccc;text-align: center;;">
						{if condition="$v.status === 1"}
						<p style="color:#53caff">待商户确认...</p>
						{elseif condition="$v.status === 2"/}
						<p style="color:#53caff">商户已确认</p>
						{elseif condition="$v.status === 3"/}
						<p style="color:#53caff">押金退还申请中...</p>
						{elseif condition="$v.status === 4"/}
						<p style="color:#53caff">押金已退还</p>
						{/if}
						<!--
                        <p style="color:#53caff">待押金退还申请中...</p>
                        <p style="color:#53caff">待押金已退还</p>-->
					</div>
				</li>
				{/volist}
				{/if}
			</ul>
			
			
		
		
		</div>

		<div id="apply_return_proper" class="mui-popover" style="background-color:#fff;position:fixed;top:120px;left:50px;padding-top:10px;">
			<div style="text-align: center;"><img class="xuzhi" src="__WX__/img/xuzhi.png" style="width:31px;vertical-align:middle;">申请退还</div>
			<div style="padding:10px;margin-bottom:15px">
				<form id="apply_return_go">
					<input type="hidden" name="order_id" id="order_id">
					<input type="hidden" name="order_num" id="order_num">
					<input type="hidden" name="money" id="money">
					<input type="hidden" name="apply_name" id="apply_name">
					<input type="hidden" name="sh_id" id="apply_id">
					<input type="hidden" name="table_id" id="table_id">
					<input type="hidden" name="mid" id="mid">
					<div class="mui-input-row" style="border-bottom:1px solid #53caff;margin-top:10px;">
						<label style="width:22%;padding:0px;margin-top:11px;border-right:2px solid #999">账户名</label>
						<input type="text" name="username" class="mui-input-clear " placeholder="请输入账户名" style="width:78%;float:left;padding-left:6px;">
					</div>
					<div class="mui-input-row" style="border-bottom:1px solid #53caff;margin-top:10px;">
						<label style="width:22%;padding:0px;margin-top:11px;border-right:2px solid #999">开户行</label>
						<input type="text" name="bank" class="mui-input-clear " placeholder="请输入开户行" style="width:78%;float:left;padding-left:6px;">
					</div>
					<div class="mui-input-row" style="border-bottom:1px solid #53caff;margin-top:10px;">
						<label style="width:22%;padding:0px;margin-top:11px;border-right:2px solid #999">卡&nbsp;&nbsp;&nbsp;&nbsp;号</label>
						<input type="text" name="num" class="mui-input-clear " placeholder="请输入卡号" style="width:78%;float:left;padding-left:6px;">
					</div>
				</form>
			</div>
			<div  style="width:100%;height:40px;text-align: center;line-height:40px;border-top:1px solid #ccc;color:#53caff">
				<div  class="ok_no" style="width:50%;text-align: center;float:left">取消</div>
				<div class="ok_yes" style="width:50%;text-align: center;float:left">确定</div>
			</div>
		</div>
	</body>
	<script src="__WX__/mui/js/mui.min.js"></script>
	<script>
        //取消
        $(".ok_no").click(function(){
            mui('.mui-popover').popover('hide');
        });
        function apply_return1(id,order_num,money,name,apply_id,mid,table_id){
			$('#order_id').val(id);
            $('#order_num').val(order_num);
            $('#money').val(money);
            $('#apply_name').val(name);
            $('#apply_id').val(apply_id);
            $('#mid').val(mid);
            $('#table_id').val(table_id);
            mui('#apply_return_proper').popover('show');
		}

        function apply_return2(id,order_num,money,name,apply_id,mid,table_id){
            $('#order_id').val(id);
            $('#order_num').val(order_num);
            $('#money').val(money);
            $('#name').val(name);
            $('#apply_id').val(apply_id);
            $('#mid').val(mid);
            $('#table_id').val(table_id);
            mui('#apply_return_proper').popover('show');
        }

        function apply_return3(id,order_num,money,name,apply_id,mid,table_id){
            $('#order_id').val(id);
            $('#order_num').val(order_num);
            $('#money').val(money);
            $('#name').val(name);
            $('#apply_id').val(apply_id);
            $('#mid').val(mid);
            $('#table_id').val(table_id);
        }

        function apply_return4(id,order_num,money,name,apply_id,mid,table_id){
            $('#order_id').val(id);
            $('#order_num').val(order_num);
            $('#money').val(money);
            $('#name').val(name);
            $('#apply_id').val(apply_id);
            $('#mid').val(mid);
        }
	</script>
	<script>
        $(".ok_yes").click(function(){
            mui.confirm('确认申请退还？', null, function(event) {
                var index = event.index;
                if (index === 1) {
                    $.ajax({
                        url:'apply_return_go',
                        type:"post",
                        data:$('#apply_return_go').serialize(),
                        success:function(res){
                            if(res == 200){
                                mui.alert('申请成功,请耐心等待');
                                setTimeout(function(){ window.location.reload();}, 1500);
                            }else{
                                mui.alert(res.msg);
                            }
                        }
                    });
                }
            });
        })
	</script>
</html>
